<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

<ul id="list"></ul>
<input type="text" id="message" placeholder="请输入消息">
<button id="send">发送</button>

<script src="js/chat.js"></script>
    <!-- <script>
        //41.浏览器内置函数
        var ws= new WebSocket("ws://localhost:8080")

        //2.连接成功
        ws.onopen=()=>{
            console.log("连接成功");
        }
        //3.服务端消息
        ws.onmessage=(msg)=>{
            console.log(msg.data);
        }
        //4.服务端出错
       ws.onerror=()=>{
        console.log("error");
       }
    </script> -->
</body>
</html>